﻿@using UsedBookTradeSystem.Models.Entity
@using UsedBookTradeSystem.Models.Dtos.OutputDtos
@using UsedBookTradeSystem.Models.Enum;
@{
    ViewData["Title"] = "Detail";
    Layout = "~/Views/Shared/_BackLayout.cshtml";
    Order order = ViewBag.Order;
    List<CartInfoOutput> Orderdetail = ViewBag.Orderdetail;

    int index = 0;
}
<div class="container-fluid flex-grow-1 container-p-y">
<h4 class="font-weight-bold py-3 mb-0">订单详情查询</h4>

<div class="card mb-4">
    <h6 class="card-header">查看订单详情</h6>
    <div class="card-body">
        <div class="form-group row">
            <label class="col-form-label col-sm-2 text-sm-right">收件人</label>
            <div class="col-sm-10">
            <input type="text" class="form-control" name="categoryName" value="@order.UserName" placeholder="请输入类别名称" readonly/>
                <div class="clearfix"></div>
            </div>
        </div>
        <div class="form-group row">
            <label class="col-form-label col-sm-2 text-sm-right">电话</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="categoryName" value="@order.Tel" placeholder="请输入类别名称" readonly/>
                <div class="clearfix"></div>
            </div>
        </div>
        <div class="form-group row">
            <label class="col-form-label col-sm-2 text-sm-right">收件地址</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="categoryName" value="@order.Address" placeholder="请输入类别名称" readonly/>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
        <h6 class="card-header">订单详情</h6>
        <table class="table card-table">
            <thead class="thead-light">
                <tr>
                    <th>#</th>
                    <th>书名</th>
                    <th>价格</th>
                    <th>数量</th>
                    <th>总价</th>
                </tr>
            </thead>
            <tbody>
                @foreach (CartInfoOutput item in Orderdetail)
                {
                    index++;
                    <tr>
                        <td scope="row" style="vertical-align:middle">@index</td>
                        <td style="vertical-align:middle">@item.BookName</td>
                        <td style="vertical-align:middle">@item.Price</td>
                        <td style="vertical-align:middle">@item.BookCount</td>
                        <td style="vertical-align:middle">￥@item.TotolPrice</td>
                    </tr>
                }
                @if (index == 0)
                {
                    <tr>
                        <td colspan="4" style="vertical-align:central;text-align:center;"> 暂无数据 </td>
                    </tr>

                }
            </tbody>
        </table>
</div>
</div>